#include <QApplication>
#include <QPushButton>
#include <QWidget>
#include <QFont>
#include <QLCDNumber>
#include <QSpinBox>
#include <QVBoxLayout>

//simple fucn with widget and a child
class DiscoWidget : public QWidget{

    public :
        DiscoWidget(QWidget *parent=0);
};


//the constructor here 
DiscoWidget::DiscoWidget(QWidget *parent):QWidget(parent){
    
    QPushButton *qbut = new QPushButton(tr("Cikk"));
    qbut->setFont(QFont("Times", 18, QFont::Bold));

    //for displaying
    QLCDNumber *lcd = new QLCDNumber(2);
    lcd->setSegmentStyle(QLCDNumber::Filled);

    QSpinBox *qspin= new QSpinBox();
    qspin->setRange(0,11);
    //the initial value
    qspin->setValue(1);

    //the slots here
    connect(qbut,SIGNAL(clicked()),qApp, SLOT(quit()));
    connect(qspin,SIGNAL(valueChanged(int)),lcd,SLOT(display(int)));

    QVBoxLayout *layout = new QVBoxLayout;
    layout->addWidget(qbut);
    layout->addWidget(lcd);
    layout->addWidget(qspin);

    setLayout(layout);
}


int main(int argc,char *argv[]){

    QApplication *app = new QApplication(argc,argv);

    DiscoWidget myWidget;
    myWidget.show();
    return app->exec();

}


